#!/usr/bin/env python3.9.2
# Date:2021/03/09
# Writed By Lemon 图片批处理工具
# -*- coding:utf-8 -*-

import os
from PIL import Image


def phototool(readfile):
    print(readfile)
    # 读取图片内容
    pic = Image.open(readfile)
    width, height = pic.size
    print("宽:", width, "高:", height)

    pic = pic.resize((50, 50), Image.ANTIALIAS)
    pic.show()


nowdir = os.getcwd()
print("当前路径为:", nowdir)
os.chdir("C:/users/LL/Desktop/python image")
dirs = os.listdir("C:/users/LL/Desktop/python image")
imagedir = "C:/users/LL/Desktop/python image"
count = 0
for file in dirs:
    phototool(file)
